﻿using System;
using System.Threading;
using System.Windows.Forms;
using OrderCms.DataAccess;
using OrderCms.Utilities;

namespace 订单分流.Api
{
	// Token: 0x02000006 RID: 6
	internal class Appconst
	{
		// Token: 0x0600001B RID: 27 RVA: 0x000030DE File Offset: 0x000012DE
		public static void ShowLog(string str)
		{
			Appconst.DlgSet.SetTextBoxAdd(Appconst.showLogText, string.Concat(new object[]
			{
				str,
				" 时间:",
				DateTime.Now,
				"\r\n"
			}));
		}

		// Token: 0x0600001C RID: 28 RVA: 0x0000311D File Offset: 0x0000131D
		public static void ShowTip(string str)
		{
			Appconst.DlgSet.SetLable(Appconst.showTipLabel, str + "\r\n时间:" + DateTime.Now);
		}

		// Token: 0x0600001D RID: 29 RVA: 0x00003148 File Offset: 0x00001348
		public static int GetThreadPoolNum()
		{
			object obj = Appconst.lockObj;
			int result;
			lock (obj)
			{
				int MaxWorkerThreads;
				int miot;
				ThreadPool.GetMaxThreads(out MaxWorkerThreads, out miot);
				int AvailableWorkerThreads;
				int aiot = AvailableWorkerThreads = 0;
				ThreadPool.GetAvailableThreads(out AvailableWorkerThreads, out aiot);
				int actThreadNum = MaxWorkerThreads - AvailableWorkerThreads;
				Appconst.ShowTip(string.Concat(new object[]
				{
					"线程池:",
					actThreadNum,
					"\r\n待分流：",
					Appconst.sendCount
				}));
				result = actThreadNum;
			}
			return result;
		}

		// Token: 0x04000013 RID: 19
		public static LogHelper log = LogFactory.GetLogger();

		// Token: 0x04000014 RID: 20
		public static bool threadFlag = false;

		// Token: 0x04000015 RID: 21
		public static bool SoftthreadFlag = true;

		// Token: 0x04000016 RID: 22
		public static int threadNum;

		// Token: 0x04000017 RID: 23
		public static int httpTimeOut = -1;

		// Token: 0x04000018 RID: 24
		public static object lockObj = new object();

		// Token: 0x04000019 RID: 25
		public static TextBox showLogText = new TextBox();

		// Token: 0x0400001A RID: 26
		public static Label showTipLabel = new Label();

		// Token: 0x0400001B RID: 27
		public static SetContorl DlgSet = new SetContorl();

		// Token: 0x0400001C RID: 28
		public static int sendCount = 0;
	}
}
